import 'package:flame/components.dart';
import 'package:flutter_flame/component/SpriteEntity.dart';

import '../../../config/GameConfig.dart';

class StageBackground extends SpriteEntity {
  StageBackground(super.spriteImg);

  @override
  Future<void> onLoad() async {
    await super.onLoad();
    final radio = sprite!.image.width / sprite!.image.height;
    final worldHeight = GameConfig.gameScreenHeight;
    final worldWidth = radio * worldHeight;
    size = Vector2(worldWidth, worldHeight);
    priority = backgroundPriority;
  }
}
